# 设计一个函数产生指定长度的验证码，验证码由大写字母构成。
import random
def genarate_code(i):
   lst = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
   list_code=[]
   for i in range(i):
       x=random.choice(lst)
       list_code.append(x)
   return ''.join(list_code)
if __name__ == '__main__':
  a=int(input('请输入需要生成的验证码长度：'))
  print(genarate_code(a))
